<script setup lang="ts">

import { getInfo } from "~/api/homo";

const router = useRouter()

const appStore = useAppStore();


onMounted(() => {

})

const infoData = ref({})

async function getData(server: boolean = true) {

  // getInfo(null, { server })
  const { data, pending, error } = await getInfo(null, { server });
  if(!error.value){
    infoData.value = data.value.user;

  }

}

getData()


const toAbout = () => {
  router.push('/about')
}

const addCount = () => {
  appStore.addCount()
}
</script>

<template>
  <div class="home-container">
    <div class="back-item">
      aaaa3333<br>
      {{ appStore.count }}
      <el-button type="primary" @click="toAbout">about</el-button>
      <el-button @click="addCount">addCount</el-button>
      <el-button @click="getData(false)">getData</el-button>
    </div>
  </div>
</template>

<style scoped lang="scss">
.home-container {
  //background: red;

  .back-item {
    //background: blue;
  }
}
</style>